<?php 
function urlswitch($urltype,$value){
	if($GLOBALS['ReWrite']){
		$url=$GLOBALS['Router'][$urltype]['surl'];
	}else{
		$url=$GLOBALS['Router'][$urltype]['durl'];
	}
	return str_replace(array('{$1}','{$2}','{$3}','{$4}'),$value,$url);
}
?>